home *** CD-ROM | disk | FTP | other *** search
Wrap
property spriteNum global isMac, isPC, gDir, gInstaller, gFileName, gIconName, gIconLink, gInstallerSelected, gBrowser, gBrowserFound, gOpenDefaultBrowser, gPlugins, gScreenRes, gWebPage, gDisclaimer, gRequired, gBrowserPresent, gPluginsPresent on startMovie buddyAPI = baRegister("MIS ICAXON", 2710890) isMac = the platform contains "Mac" isPC = not isMac sprite(2).visible = isMac sprite(4).visible = isMac gFileName = "kaiser.mypatient.com" gIconName = "kaiser.mypatient.ico" gIconLink = "KAISER~1" gRequired = [:] gRequired[#vNS] = 4 gRequired[#vIE] = 5 gRequired[#vAO] = 5 gRequired[#vNS_mac] = 4 gRequired[#vIE_mac] = 6 gRequired[#vAO_mac] = 5 gRequired[#vSW] = 8 gRequired[#vFL] = 5 gRequired[#W] = 800 gDir = [:] gDir[#dialog] = EMPTY gWebPage = [:] gWebPage[#mainPage] = "http://" & gFileName & "/" gWebPage[#help_desk] = "http://" & gFileName & "/mypatient/PublicSite/help_desk/" gInstaller = [:] gInstaller[#selected] = 1 if isMac then gInstaller[#IE] = the moviePath & ":installers:Internet Explorer 5.smi" gInstaller[#NS] = the moviePath & ":installers:Communicator‚Ñ¢ 4.75 Complete:* Start Here *" gInstaller[#PL] = the moviePath & ":installers:Shockwave Installer" gDisclaimer = the moviePath & "disclaimer:disclaimer.htm" else gInstaller[#IE] = the moviePath & "..\installers\Internet Explorer 5.0\ie5setup.exe" gInstaller[#NS] = the moviePath & "..\installers\Netscape 4.5\setup.exe" gInstaller[#PL] = the moviePath & "..\installers\Shockwave_Installer_Full.exe" gDisclaimer = the moviePath & "disclaimer\disclaimer.htm" end if gBrowserFound = EMPTY gBrowser = [:] gPlugins = [:] gScreenRes = [:] gotoNextStep() end on gotoNextStep cursor(4) gBrowser = detectBrowser(EMPTY) gPlugins = detectPlugins(gBrowser[#Path], gBrowser[#type]) gScreenRes = detectScreenResolution() if not (gBrowser[#Ok] and gBrowser[#vOK]) then nextScreen = "InstallBrowser" else if not gPlugins[#Ok] then nextScreen = "InstallPlugins" else nextScreen = "Open" end if end if go(nextScreen) cursor(-1) end on unQuote str if str.char[1] = QUOTE then str = str.char[2..str.length - 1] end if return str end on detectBrowser browser = [#Ok: 0, #vOK: 0, #Path: EMPTY, #type: EMPTY] gBrowserFound = EMPTY if isPC then defaultBrowser = baReadRegString(".htm", EMPTY, EMPTY, "HKEY_CLASSES_ROOT") defaultPath = unQuote(baReadRegString(defaultBrowser & "\shell\open\command", EMPTY, EMPTY, "HKEY_CLASSES_ROOT").word[1]) defaultVersion = baFileVersion(defaultPath).char[1..4] browser[#Ok] = (defaultBrowser = "NetscapeMarkup") or (defaultBrowser = "htmlfile") or (defaultBrowser = "aolfile_HTM") browser[#Path] = defaultPath case defaultBrowser of "NetscapeMarkup": defaultBrowser = "Netscape" browser[#vOK] = defaultVersion.char[1] = gRequired[#vNS] browser[#type] = "NS" "htmlfile": defaultBrowser = "Internet Explorer" browser[#vOK] = defaultVersion.char[1] >= gRequired[#vIE] browser[#type] = "IE" "aolfile_HTM": defaultBrowser = "America Online" browser[#vOK] = defaultVersion.char[1] >= gRequired[#vAO] browser[#type] = "AO" end case gOpenDefaultBrowser = browser[#Ok] and browser[#vOK] if not gOpenDefaultBrowser then NSpath = unQuote(baReadRegString("NetscapeMarkup\shell\open\command", EMPTY, EMPTY, "HKEY_CLASSES_ROOT").word[1]) IEpath = unQuote(baReadRegString("htmlfile\shell\open\command", EMPTY, EMPTY, "HKEY_CLASSES_ROOT").word[1]) AOpath = unQuote(baReadRegString("aolfile_HTM\shell\open\command", EMPTY, EMPTY, "HKEY_CLASSES_ROOT").word[1]) end if else gOpenDefaultBrowser = 0 NSpath = baFindApp("MOSS") IEpath = baFindApp("MSIE") AOpath = baFindApp("AOp3") browser[#Path] = baFindApp("MOSS") browser[#type] = "NS" browser[#Ok] = browser[#Path] <> EMPTY browser[#vOK] = baFileVersion(browser[#Path]).char[1] = gRequired[#vNS_mac] if not (browser[#Ok] and browser[#vOK]) then browser[#Path] = baFindApp("AOp3") browser[#type] = "AO" browser[#Ok] = browser[#Path] <> EMPTY browser[#vOK] = baFileVersion(browser[#Path]).char[1] >= gRequired[#vAO_mac] end if if not (browser[#Ok] and browser[#vOK]) then browser[#Path] = baFindApp("MSIE") browser[#type] = "IE" browser[#Ok] = browser[#Path] <> EMPTY browser[#vOK] = baFileVersion(browser[#Path]).char[1] >= gRequired[#vIE_mac] end if end if if not (browser[#Ok] and browser[#vOK]) then brwCount = 0 gBrowserFound = EMPTY browser[#Ok] = 0 browser[#vOK] = 0 if NSpath <> EMPTY then gBrowserFound = gBrowserFound & "Netscape version [" & baFileVersion(NSpath).char[1..4] & "]" & RETURN browser[#Ok] = 1 browser[#vOK] = baFileVersion(NSpath).char[1] = gRequired[#vNS] browser[#type] = "NS" browser[#Path] = NSpath brwCount = brwCount + 1 end if if not (browser[#Ok] and browser[#vOK]) and (IEpath <> EMPTY) then versionIE = baFileVersion(IEpath).char[1..4] if versionIE = "4.70" then versionIE = "3.0" end if if versionIE = "4.72" then versionIE = "4.0" end if gBrowserFound = gBrowserFound & "Internet Explorer version [" & versionIE & "]" & RETURN browser[#Ok] = 1 browser[#vOK] = baFileVersion(IEpath).char[1] >= gRequired[#vIE] browser[#type] = "IE" browser[#Path] = IEpath brwCount = brwCount + 1 end if if not (browser[#Ok] and browser[#vOK]) and (AOpath <> EMPTY) then gBrowserFound = gBrowserFound & "America Online version [" & baFileVersion(AOpath).char[1..4] & "]" & RETURN browser[#Ok] = 1 browser[#vOK] = baFileVersion(AOpath).char[1] >= gRequired[#vAO] browser[#type] = "AO" browser[#Path] = AOpath brwCount = brwCount + 1 end if if brwCount = 0 then gBrowserFound = "We have not detected a browser on your computer." & RETURN & "We recommend that you install the browser included on this CD." else if brwCount = 1 then gBrowserFound = "The browser detected on your computer is" & RETURN & RETURN & gBrowserFound & RETURN & "However, this browser is not compatible with the Dermatology Step By Step program." & RETURN & RETURN & "We recommend that you install the browser included on this CD." else gBrowserFound = "The browsers detected on your computer are" & RETURN & RETURN & gBrowserFound & RETURN & "However, these browsers are not compatible with the Dermatology Step By Step program." & RETURN & RETURN & "We recommend that you install the browser included on this CD." end if end if end if return browser end on old_detectBrowser Path browser = [#Ok: 0, #vOK: 0, #Path: EMPTY, #type: EMPTY] if isMac then browser[#Path] = baFindApp("MOSS") browser[#type] = "NS" browser[#Ok] = browser[#Path] <> EMPTY browser[#vOK] = baFileVersion(browser[#Path]).char[1] = gRequired[#vNS_mac] if not browser[#vOK] then browser[#Path] = baFindApp("AOp3") browser[#type] = "AO" browser[#Ok] = browser[#Path] <> EMPTY browser[#vOK] = baFileVersion(browser[#Path]).char[1] >= gRequired[#vAO_mac] end if if not browser[#vOK] then browser[#Path] = baFindApp("MSIE") browser[#type] = "IE" browser[#Ok] = browser[#Path] <> EMPTY browser[#vOK] = baFileVersion(browser[#Path]).char[1] >= gRequired[#vIE_mac] end if else browser[#Path] = Path if browser[#Path].length = 0 then browser[#Path] = baFindApp("htm") end if browser[#Ok] = browser[#Path] <> EMPTY if browser[#Ok] then v = baFileVersion(browser[#Path]) File = getFile(browser[#Path]) if File contains "explore" then browser[#type] = "IE" end if if File contains "netscape" then browser[#type] = "NS" end if if browser[#type] = "IE" then browser[#vOK] = v.char[1] >= gRequired[#vIE] else if browser[#type] = "NS" then browser[#vOK] = v.char[1] = gRequired[#vNS] end if end if end if end if return browser end on detectPlugins brwPath, brwType plugins = [#Ok: 0] if brwType = "IE" then if isMac then brwPluginFolder = getDir(brwPath) & "Plug-ins:" flFileA = brwPluginFolder & "Shockwave Flash NP-PPC" flFileB = baSysFolder("extensions") & "Macromedia:Shockwave 8:Xtras:Flash Asset PPC" flExist = baFileExists(flFileA) or baFileExists(flFileB) flVersA = baFileVersion(flFileA) flVersB = baFileVersion(flFileB) flVers = flVersA if flVersB.char[1] >= 4 then flVers = flVersB end if swFile = baSysFolder("extensions") & "Macromedia:Shockwave 8:Xtras:SWA Streaming PPC Xtra" swExist = baFileExists(swFile) swVers = baFileVersion(swFile) else flFile = baSysFolder("system") & "Macromed\Flash\SWFlash.ocx" flExist = baFileExists(flFile) flVers = baFileVersion(flFile) swFile = baSysFolder("system") & "Macromed\Director\SwDir.dll" swExist = baFileExists(swFile) swVers = baFileVersion(swFile) end if else if isMac then brwPluginFolder = getDir(brwPath) & "Plug-ins:" flFile = brwPluginFolder & "Shockwave Flash NP-PPC" flExist = baFileExists(flFile) flVers = baFileVersion(flFile) swFile = brwPluginFolder & "NP-PPC-Dir-Shockwave" swExist = baFileExists(swFile) swVers = baFileVersion(swFile) else brwPluginFolder = getDir(brwPath) & "plugins\" flFile = brwPluginFolder & "NPSWF32.dll" flExist = baFileExists(flFile) flVers = baFileVersion(flFile) swFile = brwPluginFolder & "np32dsw.dll" swExist = baFileExists(swFile) swVers = baFileVersion(swFile) end if end if SWpresent = swExist and (swVers.char[1] >= gRequired[#vSW]) FLpresent = flExist and (flVers.char[1] >= gRequired[#vFL]) plugins[#Ok] = FLpresent and SWpresent return plugins end on detectScreenResolution screenRes = [:] screenRes[#Ok] = getAt(getAt(the desktopRectList, 1), 3) >= gRequired[#W] return screenRes end on getDir filePath D = "\" if isMac then D = ":" end if repeat while (filePath.length > 0) and (filePath.char[filePath.length] <> D) delete char -30000 of filePath end repeat return filePath end on getFile filePath D = "\" if isMac then D = ":" end if repeat while (filePath.length > 0) and (filePath contains D) delete filePath.char[1] end repeat return filePath end on doInstall case the frameLabel of "no browser": doInstallBrowser() "no flash": doInstallPlugins() end case end on doInstallIcon end on doFinish cursor(-1) if the frameLabel <> "did not install" then doInstallIcon() end if doQuit() end on doLaunch self = baActiveWindow() doInstallIcon() if self <> baActiveWindow() then baActivateWindow(self) end if cursor(-1) gotoNetPage(gWebPage[#mainPage]) doQuit() end on doOpenDisclaimer self = baActiveWindow() if gOpenDefaultBrowser then gotoNetPage(gDisclaimer) else if isMac then Ok = baOpenFile(gDisclaimer & "l", EMPTY) else Ok = baShell("open", gBrowser[#Path], gDisclaimer, EMPTY, "normal") end if end if if self <> baActiveWindow() then baActivateWindow(self) end if cursor(-1) doQuit() end on doHelpDesk gotoNetPage(gWebPage[#help_desk]) end on doShortcut doInstallIcon() cursor(-1) doQuit() end on doRestartCD gotoNextStep() end on doInstallBrowser if gInstallerSelected = 1 then if isMac then doInstallIcon() open(gInstaller[#IE]) else cursor(4) gPlugins = detectPlugins(EMPTY, "IE") cursor(-1) if not gPlugins[#Ok] then alert("The CD-ROM will now install Flash 4.0, so that you can take advantage " & RETURN & "of the interactivity of mypatient.com." & RETURN & RETURN & "It will then proceed to the regular installation of Internet Explorer.") err = baRunProgram(gInstaller[#PL], "normal", 1) if err < 32 then alert("An error occured while running plug-in installer:" & RETURN & getError("baRunProgram", err) & RETURN & RETURN & "Please try again.") end if cursor(4) gPlugins = detectPlugins(EMPTY, "IE") cursor(-1) end if if not gPlugins[#Ok] then nextScreen = "did not install" else doInstallIcon() err = baRunProgram(gInstaller[#IE], "normal", 1) if err < 32 then alert("An error occured while running Internet Explorer installer:" & RETURN & getError("baRunProgram", err) & RETURN & RETURN & "Please try again.") end if end if cursor(-1) end if else if isMac then doInstallIcon() open(gInstaller[#NS]) else doInstallIcon() err = baRunProgram(gInstaller[#NS], "normal", 1) if err < 32 then alert("An error occured while running plug-in installer:" & RETURN & getError("baRunProgram", err) & RETURN & RETURN & "Please try again.") end if end if end if nextScreen = "exit" if 0 then cursor(4) gBrowser = detectBrowser(EMPTY) gPlugins = detectPlugins(gBrowser[#Path], gBrowser[#type]) gScreenRes = detectScreenResolution() alert("Browser detected[" & gBrowser[#Ok] & "] versionOK[" & gBrowser[#vOK] & "] path[" & gBrowser[#Path] & "] type[" & gBrowser[#type] & "]") if not gBrowser[#Ok] then nextScreen = "did not install" else if not gPlugins[#Ok] then nextScreen = "no flash" else if not gScreenRes[#Ok] then nextScreen = "not 800x600" else nextScreen = "install" end if end if end if cursor(-1) end if end on doInstallPlugins alert("After the installation," & RETURN & "please restart the program.") if isMac then open(gInstaller[#PL]) else err = baRunProgram(gInstaller[#PL], "normal", 1) if err < 32 then alert("An error occured while running plug-in installer:" & RETURN & getError("baRunProgram", err) & RETURN & RETURN & "Please try again.") end if end if doQuit() end on doInstallBrowser_IE msg = "This will copy 'Internet Explorer 5.smi' on your desktop." & RETURN msg = msg & "Open that file and follow instructions to install the" & RETURN msg = msg & "browser. After the installation is completed," & RETURN & RETURN msg = msg & "Then please restart the program." alert(msg) gInstallerSelected = 1 doInstallBrowser() doQuit() end on doInstallBrowser_NS msg = "After the browser installation is completed," & RETURN msg = msg & "please open your newly installed Netscape and" & RETURN msg = msg & "select 'Yes' when prompted to choose it as the" & RETURN msg = msg & "default browser." & RETURN & RETURN msg = msg & "Then please restart the program." alert(msg) gInstallerSelected = 2 doInstallBrowser() doQuit() end on getError errType, errNo case errType of "baCreatePMGroup": str = "Unable to make the Start Menu group" "baCreatePMIcon": str = "Unable to make the Start Menu icon" "baCopyFile": case errNo of 1: str = "Invalid Source file name" 2: str = "Invalid Destination file name" 3: str = "Error reading the Source file" 4: str = "Error writing the Destination file" 5: str = "Couldn't create directory for Destination file" 6: str = "Destination file exists" 7: str = "Destination file is newer that Source file" end case "baRunProgram": case errNo of 0: str = "System was out of memory, executable file was corrupt, or relocations were invalid." 1: str = "Unspecified error." 2: str = "File was not found." 3: str = "Path was not found." 5: str = "Attempt was made to dynamically link to a task, or there was a sharing or network-protection error." 6: str = "Library required separate data segments for each task." 8: str = "There was insufficient memory to start the application." 10: str = "Windows version was incorrect." 11: str = "Executable file was invalid. Either it was not a Windows application or there was an error in the .EXE image." 12: str = "Application was designed for a different operating system." 13: str = "Application was designed for MS-DOS 4.0." 14: str = "Type of executable file was unknown." 15: str = "Attempt was made to load a real-mode application (developed for an earlier version of Windows)." 16: str = "Attempt was made to load a second instance of an executable file containing multiple data segments that were not marked read-only." 19: str = "Attempt was made to load a compressed executable file. The file must be decompressed before it can be loaded." 20: str = "Dynamic-link library (DLL) file was invalid. One of the DLLs required to run this application was corrupt." 21: str = "Application requires 32-bit extensions." end case end case return str end on doQuit quit() end on doCancel doQuit() end